let fs = require("fs");
if (!fs.existsSync("xxx")) fs.mkdirSync("xxx");
let time = new Date().getTime();
for (let i = 0; i < 1000; i++) {
    fs.writeFileSync("xxx"+i+".txt","666")
}
let time2 = new Date().getTime();
console.log(time2-time);

let time3 = new Date().getTime();
let dream = 0;
if (!fs.existsSync("xxx")) fs.mkdirSync("xxx");
for (let j = 0; j < 2000; j++) {
    fs.writeFile("xxx"+j+".txt","666",(err) => {
        dream++;
        if (dream == 2000) {
            let time4 = new Date().getTime();
            console.log(time4-time3);
        }
    })
}


